#include <bits/stdc++.h>
using namespace std;
int n, minn = 100010, maxx = -1, ans;
struct node{
    int many, could;
}a[100010];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for(int i = 1;i <= n;i ++){
        int tmp;
        cin >> tmp;
        a[tmp].many ++;
        a[tmp].could ++;
        maxx = max(maxx, tmp);
        minn = min(minn, tmp);
    }
    for(int i = minn;i <= maxx;i ++){
        if(a[i].many != 0){
            for(int j = minn;j < i;j ++){
                if(a[j].many != 0){
                    if(a[i].could > a[j].many){
                        ans += a[j].many;
                        a[i].could -= a[j].many;
                        a[j].many = 0;
                        a[j].could = 0;
                    }else{
                        ans += a[i].could;
                        a[j].many -= a[i].could;
                        a[i].could = 0;
                    }
                }
            }
        }
    }
    cout << n - ans;
    return 0;
}
